#ifndef CHAT_H
#define CHAT_H

#include <QWidget>
#include <iostream>
#include <winsock2.h>
#include <thread>
#include <mutex>
#include <signal.h>
#include <QDebug>
#include <QString>
//#pragma comment(lib, "ws2_32.lib")//连接库 LIBS += -lws2_32
#define MAX_LEN 200
using namespace std;
extern bool exit_flag;
extern thread t_send, t_recv;
extern SOCKET client_socket;
namespace Ui {
class Chat;
}

class Chat : public QWidget
{
    Q_OBJECT
private:
    QString uid;
    QString name;
    Ui::Chat *ui;
    unsigned short port=10000;
    QString ip="127.0.0.1";//47.115.215.143 192.168.6.129

public:
    explicit Chat(QWidget *parent,QString uid,QString name);
    ~Chat();
private slots:
    void on_pushButton_2_clicked();
    void on_pushButton_clicked();
    void on_pushButton_3_clicked();

signals:
    void startConnect(unsigned short,QString);
    void sendmsg(QByteArray);
};

#endif // CHAT_H
